Namespaces
Functions
string|array|null
__(string|null $key = null, array $replace = [], string|null $locale = null)
Translate the given message.
never
abort(
Response |
Responsable |int $code, string $message = '', array $headers = [])
Throw an HttpException with the given data.
void
abort_if(bool $boolean,
Response |
Responsable |int $code, string $message = '', array $headers = [])
Throw an HttpException with the given data if the given condition is true.
void
abort_unless(bool $boolean,
Response |
Responsable |int $code, string $message = '', array $headers = [])
Throw an HttpException with the given data unless the given condition is true.
string
action(string|array $name, mixed $parameters = [], bool $absolute = true)
Generate the URL to a controller action.
app(string|
TClass> |null $abstract = null, array $parameters = [])
Get the available container instance.
string
app_path(string $path = '')
Get the path to the application folder.
array
append_config(array $array)
Assign high numeric IDs to a config item to force appending.
string
asset(string $path, bool|null $secure = null)
Generate an asset path for the application.
auth(string|null $guard = null)
Get the available auth instance.
back(int $status = 302, array $headers = [], mixed $fallback = false)
Create a new redirect response to the previous location.
string
base_path(string $path = '')
Get the path to the base of the install.
string
bcrypt(string $value, array $options = [])
Hash the given value against the bcrypt algorithm.
bool
blank(mixed $value)
Determine if the given value is "blank".
broadcast(mixed|null $event = null)
Begin broadcasting an event.
CacheManager : ($key is string ? mixed : bool))
cache(string|array<string, mixed>|null $key = null, mixed $default = null)
Get / set the specified cache value.
string
class_basename(string|object $class)
Get the class "basename" of the given object / class.
array
class_uses_recursive(object|string $class)
Returns all traits used by a class, its parent classes and trait of their traits.
collect(
TValue> |
TValue> |null $value = [])
Create a collection from the given value.
Repository : ($key is string ? mixed : null))
config(array<string, mixed>|string|null $key = null, mixed $default = null)
Get / set the specified configuration value.
string
config_path(string $path = '')
Get the configuration path.
context(array|string|null $key = null, mixed $default = null)
Get / set the specified context value.
cookie(string|null $name = null, string|null $value = null, int $minutes = 0, string|null $path = null, string|null $domain = null, bool|null $secure = null, bool $httpOnly = true, bool $raw = false, string|null $sameSite = null)
Create a new cookie instance.
csrf_field()
Generate a CSRF token form field.
string
csrf_token()
Get the CSRF token value.
mixed
data_fill(mixed $target, string|array $key, mixed $value)
Fill in data where it's missing.
mixed
data_forget(mixed $target, string|array|int|null $key)
Remove / unset an item from an array or object using "dot" notation.
mixed
data_get(mixed $target, string|array|int|null $key, mixed $default = null)
Get an item from an array or object using "dot" notation.
mixed
data_set(mixed $target, string|array $key, mixed $value, bool $overwrite = true)
Set an item on an array or object using dot notation.
string
database_path(string $path = '')
Get the database path.
mixed
decrypt(string $value, bool $unserialize = true)
Decrypt the given value.
defer(callable|null $callback = null, string|null $name = null, bool $always = false)
Defer execution of the given callback.
dispatch(mixed $job)
Dispatch a job to its appropriate handler.
mixed
dispatch_now(mixed $job, mixed $handler = null)
deprecated
Dispatch a command to its appropriate handler in the current process.
mixed
dispatch_sync(mixed $job, mixed $handler = null)
Dispatch a command to its appropriate handler in the current process.
string
elixir(string $file, string $buildDirectory = 'build')
deprecated
Get the path to a versioned Elixir file.
string
encrypt(mixed $value, bool $serialize = true)
Encrypt the given value.
mixed
env(string $key, mixed $default = null)
Gets the value of an environment variable.
array|null
event(...$args)
Dispatch an event and call the listeners.
factory(string $class, int $amount = null)
Create a model factory builder for a given class and amount.
fake(string|null $locale = null)
Get a faker instance.
bool
filled(mixed $value)
Determine if a value is "filled".
fluent(object|array $value)
Create a Fluent object from the given value.
mixed
head(array $array)
Get the first element of an array. Useful for method chaining.
void
info(string $message, array $context = [])
Write some information to the log.
string
lang_path(string $path = '')
Get the path to the language folder.
bool
laravel_cloud()
Determine if the application is running on Laravel Cloud.
mixed
last(array $array)
Get the last element from an array.
literal(...$arguments)
Return a new literal or anonymous object using named arguments.
logger(string|null $message = null, array $context = [])
Log a debug message to the logs.
logs(string|null $driver = null)
Get a log driver instance.
method_field(string $method)
Generate a form field to spoof the HTTP verb used by forms.
mix(string $path, string $manifestDirectory = '')
Get the path to a versioned Mix file.
now(
DateTimeZone |string|null $tz = null)
Create a new Carbon instance for the current time.
object_get(TValue $object, string|null $key, mixed $default = null)
Get an item from an object using "dot" notation.
string|array|null
old(string|null $key = null,
Model |string|array|null $default = null)
Retrieve an old input item.
TReturnType
once(callable $callback)
Ensures a callable is only called once, and returns the result on subsequent calls.
optional(TValue $value = null, callable|null $callback = null)
Provide access to optional objects.
mixed
policy(object|string $class)
Get a policy instance for a given class.
mixed
precognitive(null|callable $callable = null)
Handle a Precognition controller hook.
string
preg_replace_array(string $pattern, array $replacements, string $subject)
Replace a given pattern with each value in the array in sequentially.
string
public_path(string $path = '')
Get the path to the public folder.
redirect(string|null $to = null, int $status = 302, array $headers = [], bool|null $secure = null)
Get an instance of the redirector.
void
report(
Throwable |string $exception)
Report an exception.
void
report_if(bool $boolean,
Throwable |string $exception)
Report an exception if the given condition is true.
void
report_unless(bool $boolean,
Throwable |string $exception)
Report an exception unless the given condition is true.
Request : ($key is string ? mixed : array<string, mixed>))
request(list<string>|string|null $key = null, mixed $default = null)
Get an instance of the current request or an input item from the request.
TValue|TFallback
rescue(callable $callback,
TFallback |TFallback $rescue = null, bool|
Throwable): bool $report = true)
Catch a potential exception and return a default value.
resolve(string|
TClass> $name, array $parameters = [])
Resolve a service from the container.
string
resource_path(string $path = '')
Get the path to the resources folder.
response(
View |string|array|null $content = null, int $status = 200, array $headers = [])
Return a new response from the application.
TValue
retry(int|array<int, int> $times, callable $callback, int|
Throwable): int $sleepMilliseconds = 0,
Throwable): bool |null $when = null)
Retry an operation a given number of times.
string
route(BackedEnum|string $name, mixed $parameters = [], bool $absolute = true)
Generate the URL to a named route.
string
secure_asset(string $path)
Generate an asset path for the application.
string
secure_url(string $path, mixed $parameters = [])
Generate a HTTPS url for the application.
SessionManager : ($key is string ? mixed : null))
session(array<string, mixed>|string|null $key = null, mixed $default = null)
Get / set the specified session value.
string
storage_path(string $path = '')
Get the path to the storage folder.
str(string|null $string = null)
Get a new stringable object from the given string.
tap(TValue $value,
TValue): mixed |null $callback = null)
Call the given Closure with the given value then return the value.
throw_if($condition, $exception = 'RuntimeException', ...$parameters)
Throw the given exception if the given condition is true.
throw_unless($condition, $exception = 'RuntimeException', ...$parameters)
Throw the given exception unless the given condition is true.
to_route(BackedEnum|string $route, mixed $parameters = [], int $status = 302, array $headers = [])
Create a new redirect response to a named route.
today(
DateTimeZone |string|null $tz = null)
Create a new Carbon instance for the current date.
array
trait_uses_recursive(object|string $trait)
Returns all traits used by a trait and its traits.
Translator : array |string)
trans(string|null $key = null, array $replace = [], string|null $locale = null)
Translate the given message.
string
trans_choice(string $key,
Countable |int|float|array $number, array $replace = [], string|null $locale = null)
Translates the given message based on a count.
url(string|null $path = null, mixed $parameters = [], bool|null $secure = null)
Generate a url for the application.
validator(array|null $data = null, array $rules = [], array $messages = [], array $attributes = [])
Create a new Validator instance.
TValue
value(TValue|
TValue $value, TArgs ...$args)
Return the default value of the given value.
view(string|null $view = null,
Arrayable |array $data = [], array $mergeData = [])
Get the evaluated view contents for the given view.
mixed
when(mixed $condition,
Closure |mixed $value,
Closure |mixed $default = null)
Return a value if the given condition is true.
bool
windows_os()
Determine whether the current environment is Windows based.
with(TValue $value, callable|null $callback = null)
Return the given value, optionally passed through the given callback.
Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud .